<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>FACOPOLY:  Fichier source de /home/etu/g/p0804564/facopoly/src/JEU.c</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">FACOPOLY
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Généré par Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li><a href="dirs.html"><span>Répertoires</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Membres&#160;de&#160;fichier</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_j_e_u_8c.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">JEU.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_j_e_u_8c.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00003"></a>00003 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;string.h&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="_j_e_u_8h.html" title="facopoly  Permet de jouer au facopoly">JEU.h</a>&quot;</span>
<a name="l00006"></a>00006 
<a name="l00007"></a><a class="code" href="_j_e_u_8h.html#acfbdc4b01c93cd74c5a9e7b3d04c2d2a">00007</a> <span class="keywordtype">void</span> <a class="code" href="_j_e_u_8c.html#acfbdc4b01c93cd74c5a9e7b3d04c2d2a" title="Initialisation du jeu.">jeInit_Jeu</a>(<a class="code" href="struct_j_e_u.html">JEU</a>* je)
<a name="l00008"></a>00008 {
<a name="l00009"></a>00009     je-&gt;<a class="code" href="struct_j_e_u.html#ae44ed5eab067b876d6ba43a4f7857b33">de</a>=<a class="code" href="_d_e_8c.html#a957d0db869716ba32b741d8e3ff263c8" title="Création des dés.">deCreer_De</a>();
<a name="l00010"></a>00010     je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>=<a class="code" href="_p_i_o_n_8c.html#ae53cd93aa0836069283089a7631a2041" title="Initialisation des pions de jeu.">piCreer_Pion</a>();
<a name="l00011"></a>00011     je-&gt;<a class="code" href="struct_j_e_u.html#ac01d84655bbde9d9e9ccba147190aba8">ta</a>=<a class="code" href="_c_a_s_e_8c.html#a02e94a8e7b4ce013d26b081933ca86f2" title="Initialisation d&#39;une case de jeu.">caInit_Case</a>();
<a name="l00012"></a>00012 }
<a name="l00013"></a>00013 
<a name="l00014"></a><a class="code" href="_j_e_u_8h.html#acd2a0effb98db738cadbfd8d11827228">00014</a> <span class="keywordtype">int</span> <a class="code" href="_j_e_u_8c.html#acd2a0effb98db738cadbfd8d11827228" title="permet de récupérer la valeur des dés">jeRecup_Des</a>(<a class="code" href="struct_j_e_u.html">JEU</a>* je)
<a name="l00015"></a>00015 {
<a name="l00016"></a>00016     <span class="keywordtype">int</span> d;
<a name="l00017"></a>00017     assert (je!=NULL);
<a name="l00018"></a>00018     <a class="code" href="_d_e_8c.html#a0df7f1a0e0decb72b48d2b99715fbb1e" title="Tirage Aléatoire des dés.">deTirage_Alea</a>(je-&gt;<a class="code" href="struct_j_e_u.html#ae44ed5eab067b876d6ba43a4f7857b33">de</a>);
<a name="l00019"></a>00019     printf(<span class="stringliteral">&quot;valeur du dé numéro 1 : %d \n valeur du dé numéro 2 : %d \n&quot;</span>, je-&gt;<a class="code" href="struct_j_e_u.html#ae44ed5eab067b876d6ba43a4f7857b33">de</a>-&gt;<a class="code" href="struct_d_e.html#a9d5027a2fcc2dd94397641b8dff26e9c">de1</a>, je-&gt;<a class="code" href="struct_j_e_u.html#ae44ed5eab067b876d6ba43a4f7857b33">de</a>-&gt;<a class="code" href="struct_d_e.html#a99ff079b9da0e3cf4c4a324b607e558e">de2</a>);
<a name="l00020"></a>00020     d = je-&gt;<a class="code" href="struct_j_e_u.html#ae44ed5eab067b876d6ba43a4f7857b33">de</a>-&gt;<a class="code" href="struct_d_e.html#a9d5027a2fcc2dd94397641b8dff26e9c">de1</a> + je-&gt;<a class="code" href="struct_j_e_u.html#ae44ed5eab067b876d6ba43a4f7857b33">de</a>-&gt;<a class="code" href="struct_d_e.html#a99ff079b9da0e3cf4c4a324b607e558e">de2</a>;
<a name="l00021"></a>00021     <span class="keywordflow">return</span> d;
<a name="l00022"></a>00022 }
<a name="l00023"></a>00023 
<a name="l00024"></a><a class="code" href="_j_e_u_8h.html#a05f0193d4baacd4cf598cddff0b4c186">00024</a> <span class="keywordtype">void</span> <a class="code" href="_j_e_u_8c.html#a05f0193d4baacd4cf598cddff0b4c186" title="permet le changement de position du pion">jeDeplacement_Pion</a>(<a class="code" href="struct_j_e_u.html">JEU</a>* je)
<a name="l00025"></a>00025 {
<a name="l00026"></a>00026     <span class="keywordtype">int</span> d;
<a name="l00027"></a>00027     d=<a class="code" href="_j_e_u_8c.html#acd2a0effb98db738cadbfd8d11827228" title="permet de récupérer la valeur des dés">jeRecup_Des</a>(je);
<a name="l00028"></a>00028     <span class="keywordflow">while</span> (d!=0)
<a name="l00029"></a>00029     {
<a name="l00030"></a>00030         je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a8a799d21041120fa7327078bd2f0a907">num</a> = je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a8a799d21041120fa7327078bd2f0a907">num</a> + d;
<a name="l00031"></a>00031         je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#ad0797269cc35e83cbf62590bd6c91180">x_dep</a> = je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a325a93cba2e9a6994db886498a5c771f">x</a>;
<a name="l00032"></a>00032         je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#aa7f217e70832754355800b3b488500f1">y_dep</a> = je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a91579a41a8df76184516c0ce988012ef">y</a>;
<a name="l00033"></a>00033         d --;
<a name="l00034"></a>00034     }
<a name="l00035"></a>00035 
<a name="l00036"></a>00036 }
<a name="l00037"></a>00037 
<a name="l00038"></a><a class="code" href="_j_e_u_8h.html#acdc1ada047b2450fae62854af83c1c5a">00038</a> <span class="keywordtype">void</span> <a class="code" href="_j_e_u_8c.html#acdc1ada047b2450fae62854af83c1c5a" title="Permet de mettre à jour les scores des joueurs.">jeActualise_Note</a>(<a class="code" href="struct_j_e_u.html">JEU</a>* je)
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040     <span class="keywordflow">if</span> (je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a361abe0200c14ee036815f4a0ce71154">proprietaire</a> != NULL)
<a name="l00041"></a>00041     {
<a name="l00042"></a>00042         je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a> = je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a> - je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a2c32ecb2321ea91ecf560fc10e9648f1">prix_a_payer</a>;
<a name="l00043"></a>00043         <span class="keywordflow">if</span>(je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a361abe0200c14ee036815f4a0ce71154">proprietaire</a> != je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#aa9170b8b15418c23865081d0e0eeef67">nom</a>)
<a name="l00044"></a>00044         {
<a name="l00045"></a>00045             strcpy(je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#aa9170b8b15418c23865081d0e0eeef67">nom</a> , je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a361abe0200c14ee036815f4a0ce71154">proprietaire</a>);
<a name="l00046"></a>00046             je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a> = je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a> + je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a2c32ecb2321ea91ecf560fc10e9648f1">prix_a_payer</a>;
<a name="l00047"></a>00047         }
<a name="l00048"></a>00048     }
<a name="l00049"></a>00049     <span class="keywordflow">else</span>
<a name="l00050"></a>00050     {
<a name="l00051"></a>00051         <span class="keywordtype">char</span> c;
<a name="l00052"></a>00052         printf(<span class="stringliteral">&quot;Voulez vous acheter la carte : O pour oui et N pour non\n&quot;</span>);
<a name="l00053"></a>00053         scanf(<span class="stringliteral">&quot;%s&quot;</span>, &amp;c);
<a name="l00054"></a>00054         <span class="keywordflow">if</span> (c==<span class="charliteral">&#39;O&#39;</span>)
<a name="l00055"></a>00055         {
<a name="l00056"></a>00056             je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a> = je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a> - je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a202fd477b149ad236590ac410da6e4a1">prix_achat</a>;
<a name="l00057"></a>00057             strcpy(je-&gt;<a class="code" href="struct_j_e_u.html#a9e6d262ae057c99e05ff9dc5cad6e593">ca</a>-&gt;<a class="code" href="struct_c_a_s_e.html#a361abe0200c14ee036815f4a0ce71154">proprietaire</a>, je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#aa9170b8b15418c23865081d0e0eeef67">nom</a>);
<a name="l00058"></a>00058         }
<a name="l00059"></a>00059 
<a name="l00060"></a>00060     }
<a name="l00061"></a>00061 }
<a name="l00062"></a>00062 
<a name="l00063"></a>00063 
<a name="l00064"></a><a class="code" href="_j_e_u_8h.html#ade81b17804b18460bcfc2be0f0768e78">00064</a> <span class="keywordtype">void</span> <a class="code" href="_j_e_u_8c.html#ade81b17804b18460bcfc2be0f0768e78" title="Permet d&#39;améliorer une case.">jeAmelioration</a>(<a class="code" href="struct_j_e_u.html">JEU</a>* je)
<a name="l00065"></a>00065 {
<a name="l00066"></a>00066     <a class="code" href="struct_c_a_s_e.html" title="Module des cases du jeu.">TABCASE</a> ta = je-&gt;<a class="code" href="struct_j_e_u.html#ac01d84655bbde9d9e9ccba147190aba8">ta</a>;
<a name="l00067"></a>00067     <span class="keywordtype">int</span> j;
<a name="l00068"></a>00068     <span class="keywordtype">int</span> i=0;
<a name="l00069"></a>00069     <span class="keywordtype">char</span> c;
<a name="l00070"></a>00070     <span class="keywordflow">for</span> (j=je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>-3; j&lt;je-&gt;pi-&gt;numcase+3;j++)
<a name="l00071"></a>00071     {
<a name="l00072"></a>00072         <span class="keywordflow">if</span>(strcmp(ta[j].couleur,ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#ab5f221d611ae7b62e9b3d4da5cc33d3e">couleur</a>)==1)
<a name="l00073"></a>00073         {
<a name="l00074"></a>00074             <span class="keywordflow">if</span>(strcmp(ta[j].proprietaire,ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a361abe0200c14ee036815f4a0ce71154">proprietaire</a>)==1)
<a name="l00075"></a>00075             {
<a name="l00076"></a>00076                 i=i+1;
<a name="l00077"></a>00077             }
<a name="l00078"></a>00078         }
<a name="l00079"></a>00079     }
<a name="l00080"></a>00080     <span class="keywordflow">if</span> ((strcmp(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#ab5f221d611ae7b62e9b3d4da5cc33d3e">couleur</a>, <span class="stringliteral">&quot;bleu foncé&quot;</span>)==1)  || (strcmp(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#ab5f221d611ae7b62e9b3d4da5cc33d3e">couleur</a>,<span class="stringliteral">&quot;violet&quot;</span>)==1))
<a name="l00081"></a>00081     {
<a name="l00082"></a>00082         <span class="keywordflow">if</span> (i==2)
<a name="l00083"></a>00083         {
<a name="l00084"></a>00084             printf(<span class="stringliteral">&quot;Voulez vous améliorer votre case : O pour oui N pour non\n&quot;</span>);
<a name="l00085"></a>00085             scanf(<span class="stringliteral">&quot;%s /n&quot;</span>, &amp;c);
<a name="l00086"></a>00086             <span class="keywordflow">if</span> (c==<span class="charliteral">&#39;O&#39;</span>)
<a name="l00087"></a>00087             {
<a name="l00088"></a>00088                 <span class="keywordflow">if</span>(je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a>&gt;=je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a>-(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a202fd477b149ad236590ac410da6e4a1">prix_achat</a>*i))
<a name="l00089"></a>00089                 {
<a name="l00090"></a>00090                     ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a00f8194e9017470315833fc945572b89">niveau</a> ++;
<a name="l00091"></a>00091                     je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a> = je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a>-(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a202fd477b149ad236590ac410da6e4a1">prix_achat</a>*i);
<a name="l00092"></a>00092                     <span class="keywordflow">for</span> (j=je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>-3; j&lt;je-&gt;pi-&gt;numcase+3;j++)
<a name="l00093"></a>00093                     {
<a name="l00094"></a>00094                         <span class="keywordflow">if</span>(ta[j].couleur==ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#ab5f221d611ae7b62e9b3d4da5cc33d3e">couleur</a>)
<a name="l00095"></a>00095                         {
<a name="l00096"></a>00096                             ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a2c32ecb2321ea91ecf560fc10e9648f1">prix_a_payer</a>=ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a2c32ecb2321ea91ecf560fc10e9648f1">prix_a_payer</a>+(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a2c32ecb2321ea91ecf560fc10e9648f1">prix_a_payer</a>*(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a00f8194e9017470315833fc945572b89">niveau</a>/3));
<a name="l00097"></a>00097                         }
<a name="l00098"></a>00098                     }
<a name="l00099"></a>00099                 }
<a name="l00100"></a>00100                 <span class="keywordflow">else</span> printf(<span class="stringliteral">&quot;Vous n&#39;avez pas assez de points\n&quot;</span>);
<a name="l00101"></a>00101             }
<a name="l00102"></a>00102         }
<a name="l00103"></a>00103     }
<a name="l00104"></a>00104     <span class="keywordflow">if</span> (i==3)
<a name="l00105"></a>00105     {
<a name="l00106"></a>00106         printf(<span class="stringliteral">&quot;Voulez vous améliorer votre case : O pour oui N pour non\n&quot;</span>);
<a name="l00107"></a>00107         scanf(<span class="stringliteral">&quot;%s /n&quot;</span>, &amp;c);
<a name="l00108"></a>00108         <span class="keywordflow">if</span> (c==<span class="charliteral">&#39;O&#39;</span>)
<a name="l00109"></a>00109         {
<a name="l00110"></a>00110             <span class="keywordflow">if</span>(je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a>&gt;=je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a>-(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a202fd477b149ad236590ac410da6e4a1">prix_achat</a>*i))
<a name="l00111"></a>00111             {
<a name="l00112"></a>00112                 ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a00f8194e9017470315833fc945572b89">niveau</a> ++;
<a name="l00113"></a>00113                 je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a> = je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a39e697a097e7885a007da7a5e2e12851">jo</a>-&gt;<a class="code" href="struct_j_o_u_e_u_r.html#ada99b70632b597d7f31f3e2755c067dd">note</a>-(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a202fd477b149ad236590ac410da6e4a1">prix_achat</a>*i);
<a name="l00114"></a>00114                 <span class="keywordflow">for</span> (j=je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>-3; j&lt;je-&gt;pi-&gt;numcase+3;j++)
<a name="l00115"></a>00115                 {
<a name="l00116"></a>00116                     <span class="keywordflow">if</span>(ta[j].couleur==ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#ab5f221d611ae7b62e9b3d4da5cc33d3e">couleur</a>)
<a name="l00117"></a>00117                     {
<a name="l00118"></a>00118                         ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a2c32ecb2321ea91ecf560fc10e9648f1">prix_a_payer</a>=ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a2c32ecb2321ea91ecf560fc10e9648f1">prix_a_payer</a>+(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a2c32ecb2321ea91ecf560fc10e9648f1">prix_a_payer</a>*(ta[je-&gt;<a class="code" href="struct_j_e_u.html#ade236ee3443b745c20023e971d2d9a44">pi</a>-&gt;<a class="code" href="struct_p_i_o_n.html#a082d8b6dc1b789412832f2284d9f38e1">numcase</a>].<a class="code" href="struct_c_a_s_e.html#a00f8194e9017470315833fc945572b89">niveau</a>/3));
<a name="l00119"></a>00119                     }
<a name="l00120"></a>00120                 }
<a name="l00121"></a>00121             }
<a name="l00122"></a>00122             <span class="keywordflow">else</span> printf(<span class="stringliteral">&quot;Vous n&#39;avez pas assez de points\n&quot;</span>);
<a name="l00123"></a>00123         }
<a name="l00124"></a>00124     }
<a name="l00125"></a>00125 }
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_j_e_u_8c.html">JEU.c</a>      </li>

    <li class="footer">Généré le Mardi Mai 14 2013 08:10:34 pour FACOPOLY par
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
